% clear all;
% clc;

% ----------------------- Importing Data ----------------------------------

noaxons = 200;
th_elec = -10; % 0, -10, and -20

loctag = '_sub_atp_dc_act_p1_d0p2';
thtag  = ['_t',strrep(num2str(th_elec),'-','n')];

cd('p1_act_curves');

dc_th = load(['pos',loctag,thtag,'.txt']);
dcbyderm = zeros(10,10);
dcbyderm(:) = dc_th(1:(noaxons/2),1);

cd ..;

aa = 1:10;
bb = (aa'*ones(1,10))';
xx = bb(:);
yy = dcbyderm(:);

% rtt1 = 4/0.011493/1e3;
% ratp = 4/0.005924/1e3;
% yy = yy/rtt1;

% ---------------------- Plotting Results ---------------------------------

thtag = ['Lateral Deviation = ',num2str(th_elec),'^o'];
t8_vertlv  = {'T9','T10/11','T12','L1','L2/3','L3/4','L5','S1/2','S2/3','S4/5'};

figure;
hold on;
plot(xx,yy,'k.','MarkerSize',30);
ttl = ['Patient 1, ',thtag];
title(ttl,'FontSize',30);
ylabel('Stimulation Amplitude (V)','FontSize',30);
hold off;
xlim([0,11]);
ylim([0,1]);
set(gca,'XTick',[],'FontSize',26);
% set(gca,'YScale','Log');
for jj = 1:length(t8_vertlv)
    nolet = length(t8_vertlv{jj});
    text(jj-0.175*nolet/2,-0.05,t8_vertlv{jj},'FontSize',30);
end
